<?php 

class AppMainController
{	
	
    //-------------------------------------------
	
	function __construct() {
		
		if (!isset($_SESSION["appMessages"])){
			$_SESSION["appMessages"]=array();
		}	
	}
	
	
	//-------------------------------------------
	
	function addMessage($message) {
	
		$_SESSION["appMessages"][]=$message;

	}
	
	//-------------------------------------------
	
	function getMessages() {
		
		foreach ($_SESSION["appMessages"] as $key => $message){
			$aux.= " "  . $message;
		}	

		$_SESSION["appMessages"]=array();
		return $aux;
		
	}
	
	//-------------------------------------------
	
	function doInit() {
	
		$ui=new RoomsUI();
		$ui->data=Spyc::YAMLLoad('../yaml/rooms.yaml');
		$ui->display();
	}
	
	//-------------------------------------------
	
	function doSendMail() {
	
		$ctr=new ConsultaPorMail();
		$ctr->control();
	}
}	
?>